package com.bmps.springcloud.insuredmicroservice.model.accept.response;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import java.io.Serializable;

/**
 *  @author lyw
 *  @date 2019/07/24
 */
@JsonPropertyOrder({"resultCode", "resultMessage"})
@NoArgsConstructor
@AllArgsConstructor
public class ResultModel implements Serializable {

    @XStreamAlias("ResultCode")
    private String resultCode;
    @XStreamAlias("ResultMessage")
    private String resultMessage;

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultMessage() {
        return resultMessage;
    }

    public void setResultMessage(String resultMessage) {
        this.resultMessage = resultMessage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o){
            return true;
        }

        if (o == null || getClass() != o.getClass()){
            return false;
        }

        ResultModel that = (ResultModel) o;

        return new EqualsBuilder()
                .append(resultCode, that.resultCode)
                .append(resultMessage, that.resultMessage)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(resultCode)
                .append(resultMessage)
                .toHashCode();
    }

    @Override
    public String toString() {
        return "ResultListModel{" +
                "resultCode='" + resultCode + '\'' +
                ", resultMessage='" + resultMessage + '\'' +
                '}';
    }
}
